<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="re.kitri.common.game.GameDTO" %>

<%GameDTO gameDTO = (GameDTO)request.getAttribute("gameDTO");%>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.0.min.js'></script>
<script language='javascript' type='text/javascript'>
//<![CDATA[
function gameInfoDelete(deletegame_seq){
	
	document.shedule_update.action = "/gameServlet?divide=game_Info_delete&deleteSeq=" + deletegame_seq;
	document.shedule_update.submit();
}

$(document).ready(function() {
	//var tmp1 = $('[name=hometeam_select]').val();
	
	var a = '<%=gameDTO.getHomeTeam()%>';
	
    $('[name=hometeam_select]').val(a);
    //alert(tmp1.val() == tmp2.val());
    
    $('select[name=awayteam_select]').val('<%=gameDTO.getAwayTeam()%>');
    $('select[name=check_select]').val('<%=gameDTO.getGameCheck()%>');
    $('select[name=check_result]').val('<%=gameDTO.getGameResult()%>');
    
    
});


//]]>
</script>
<form method="post" name="shedule_update" action="/gameServlet">
<input type="hidden" name="divide" value="update_game">
<input type="hidden" name="gameseq" value=<%=gameDTO.getGameSeq()%>>
<br><br><br><br><br><br>
<table id ="customers" border="3" align="center">

<tr>
	<td>HOMETEAM</td>
	<td>
	<select name="hometeam_select">
	<option value='KIA'  selected="selected">기아</option>
	<option value='NEXEN'>넥센</option>
	<option value='DOOSAN'>두산</option>
	<option value='SAMSUNG'>삼성</option>
	<option value='LG'>LG</option>
	<option value='SK'>SK</option>
	<option value='LOTTE'>롯데</option>
	<option value='NC'>NC</option>
	<option value='HANWHA'>한화</option>
	</select>
	</td>
</tr>

<tr>
	<td>AWAYTEAM</td>
	<td>
	<select name="awayteam_select">
	<option value='KIA'  selected="selected">기아</option>
	<option value='NEXEN'>넥센</option>
	<option value='DOOSAN'>두산</option>
	<option value='SAMSUNG'>삼성</option>
	<option value='LG'>LG</option>
	<option value='SK'>SK</option>
	<option value='LOTTE'>롯데</option>
	<option value='NC'>NC</option>
	<option value='HANWHA'>한화</option>
	</select>
	</td>	
</tr>

<tr>
	<td>GAME_DATE</td>
	<td><input type="text" name="game_date" value=<%=gameDTO.getGameRegdate()%>></td>
</tr>

<tr>
	<td>GAME_CHECK</td>
	<td>	
	<select name="check_select">
	<option value="no">진행전</option>
	<option value="ok" >진행후</option>
	</select>
</td>
</tr>

<tr>
	<td>GAME_RESULT</td>
	<td>	
	<select name="check_result">
	<option value="before">beforegame</option>
	<option value="home">home</option>
	<option value="away" >away</option>
	<option value="draw" >draw</option>
	</select>
</tr>

<tr>
	<td colspan="2" align = "center">
	<input type = "submit" value = "저장하기">
	<input type = "button" value= "삭제" onclick="gameInfoDelete(<%=request.getParameter("game_seq")%>)"></td>
</tr>
	
</table>
<br><br><br><br><br><br>
</form>
